/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package xlsBeans;

import com.smartxls.WorkBook;

/**
 *
 * @author Lucas
 */
public class OccurrenceElementsXLS {
    private String individual;
    private Double individualcount;
    private String sex;
    private String behavior;
    private String lifestage;
    private String disposition;
    private String reproductivecondition;
    private String estabilishmentmean;
    private String recordedby;
    private String recordnumber;
    private String othercatalognumbers;
    private String preparations;
    private String associatedsequences;
    private String occurrencedetails;
    private String occurrenceremarks;
    private String occurrencestatus;
    
    private int sp;

    public OccurrenceElementsXLS(){
        this.individual = "";
        this.individualcount = null;
        this.sex = "";
        this.behavior = "";
        this.lifestage = "";
        this.disposition = "";
        this.reproductivecondition = "";
        this.estabilishmentmean = "";
        this.recordedby = "";
        this.recordnumber = "";
        this.othercatalognumbers = "";
        this.preparations = "";
        this.associatedsequences = "";
        this.occurrencedetails = "";
        this.occurrenceremarks = "";
        this.occurrencestatus = "";
    }

    public OccurrenceElementsXLS(WorkBook w, int l, int sp) {
        try{
            setOccurrenceElements(w, l, sp);
        }catch(Exception e){
            e.printStackTrace();
        }
    }

    public void setOccurrenceElements(WorkBook w, int l, int sp) throws Exception {
        this.individual = w.getText(l, 39 + sp);
        try{
            if(!w.getText(l, 40 + sp).trim().equals(""))
                this.individualcount = Double.parseDouble(w.getText(l, 40 + sp).replaceAll(",", "."));
            else this.individualcount = null;
        }catch(NumberFormatException e){
            this.individualcount = null;
        }
        this.sex = w.getText(l, 41 + sp);
        this.behavior = w.getText(l, 42 + sp);
        this.lifestage = w.getText(l, 43 + sp);
        this.disposition = w.getText(l, 44 + sp);
        this.reproductivecondition = w.getText(l, 45 + sp);
        this.estabilishmentmean = w.getText(l, 46 + sp);
        this.recordedby = w.getText(l, 47 + sp);
        this.recordnumber = w.getText(l, 48 + sp);
        this.othercatalognumbers = w.getText(l, 49 + sp);
        this.preparations = w.getText(l, 50 + sp);
        this.associatedsequences = w.getText(l, 51 + sp);
        this.occurrencedetails = w.getText(l, 52 + sp);
        this.occurrenceremarks = w.getText(l, 53 + sp);
        this.occurrencestatus = w.getText(l, 54 + sp);
    }

    public boolean isSetOccurence(){
        if(this.individual.equals("") && this.individualcount == null && this.sex.equals("") && this.behavior.equals("") && this.lifestage.equals("") && this.disposition.equals("") && this.reproductivecondition.equals("") && this.estabilishmentmean.equals("") && this.recordedby.equals("") && this.recordnumber.equals("") && this.othercatalognumbers.equals("") && this.preparations.equals("") && this.associatedsequences.equals("") && this.occurrencedetails.equals("") && this.occurrenceremarks.equals("") && this.occurrencestatus.equals(""))
            return  false;
        else return true;
    }

    public String getAssociatedsequences() {
        return associatedsequences;
    }

    public void setAssociatedsequences(String associatedsequences) {
        this.associatedsequences = associatedsequences;
    }

    public String getBehavior() {
        return behavior;
    }

    public void setBehavior(String behavior) {
        this.behavior = behavior;
    }

    public String getDisposition() {
        return disposition;
    }

    public void setDisposition(String disposition) {
        this.disposition = disposition;
    }

    public String getEstabilishmentmean() {
        return estabilishmentmean;
    }

    public void setEstabilishmentmean(String estabilishmentmean) {
        this.estabilishmentmean = estabilishmentmean;
    }

    public String getIndividual() {
        return individual;
    }

    public void setIndividual(String individual) {
        this.individual = individual;
    }

    public Double getIndividualcount() {
        return individualcount;
    }

    public void setIndividualcount(Double individualcount) {
        this.individualcount = individualcount;
    }

    public String getLifestage() {
        return lifestage;
    }

    public void setLifestage(String lifestage) {
        this.lifestage = lifestage;
    }

    public String getOccurrencedetails() {
        return occurrencedetails;
    }

    public void setOccurrencedetails(String occurrencedetails) {
        this.occurrencedetails = occurrencedetails;
    }

    public String getOccurrenceremarks() {
        return occurrenceremarks;
    }

    public void setOccurrenceremarks(String occurrenceremarks) {
        this.occurrenceremarks = occurrenceremarks;
    }

    public String getOccurrencestatus() {
        return occurrencestatus;
    }

    public void setOccurrencestatus(String occurrencestatus) {
        this.occurrencestatus = occurrencestatus;
    }

    public String getOthercatalognumbers() {
        return othercatalognumbers;
    }

    public void setOthercatalognumbers(String othercatalognumbers) {
        this.othercatalognumbers = othercatalognumbers;
    }

    public String getPreparations() {
        return preparations;
    }

    public void setPreparations(String preparations) {
        this.preparations = preparations;
    }

    public String getRecordedby() {
        return recordedby;
    }

    public void setRecordedby(String recordedby) {
        this.recordedby = recordedby;
    }

    public String getRecordnumber() {
        return recordnumber;
    }

    public void setRecordnumber(String recordnumber) {
        this.recordnumber = recordnumber;
    }

    public String getReproductivecondition() {
        return reproductivecondition;
    }

    public void setReproductivecondition(String reproductivecondition) {
        this.reproductivecondition = reproductivecondition;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getSp() {
        return sp;
    }

    public void setSp(int sp) {
        this.sp = sp;
    }
}
